package com.kinghood.authoritycenter.manager;


import com.kinghood.authoritycenter.common.model.dao.auth.OpenAccountDO;
import com.kinghood.authoritycenter.common.model.dao.auth.UserBaseDO;
import com.kinghood.authoritycenter.common.model.dto.AddOpenReqDTO;
import com.kinghood.authoritycenter.common.model.dto.auth.LoginDTO;
import com.kinghood.authoritycenter.common.model.dto.auth.RegisterReqDTO;
import com.kinghood.authoritycenter.common.model.dto.authority.AuthByUserDTO;
import com.kinghood.authoritycenter.common.model.dto.authority.TokenReqDTO;
import com.kinghood.authoritycenter.common.model.dto.auth.KingHoodPrincipal;
import com.kinghood.authoritycenter.common.model.dto.auth.UserDTO;

/**
 * description
 *
 * @author zhangFanJun
 * @date 2023-12-06 14:55
 **/
public interface IOauthManager {

    /**
     * 注册
     *
     * @param in 注册入参
     * @return 用户信息
     * @author zfj
     * @date 2023/12/6
     */
    UserBaseDO register(RegisterReqDTO in);

    /**
     * 登录
     *
     * @param in 登录入参
     * @return 用户信息
     * @author zfj
     * @date 2023/12/6
     */
    KingHoodPrincipal<UserDTO> login(LoginDTO in);

    /**
     * 注销
     *
     * @return 成功与否
     * @author zfj
     * @date 2023/12/6
     */
    Boolean logout(String bear);

    /**
     * 系统对接获取token
     *
     * @param in 系统秘钥
     * @return token信息
     * @author zfj
     * @date 2023/12/14
     */
    KingHoodPrincipal<OpenAccountDO> openToken(TokenReqDTO in);

    /**
     * 添加系统用户
     *
     * @param in 系统秘钥
     * @return 是否成功
     * @author zfj
     * @date 2023/12/14
     */
    Boolean addOpen(AddOpenReqDTO in);


    /**
     * 获取账号的权限
     *
     * @param issuer 发行
     * @param id 账号
     * @return 权限
     * @author zfj
     * @date 2023/12/22
     */
    AuthByUserDTO getAuth(String issuer, Long id);
}
